-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement policy resources for lb monitor profile #1036
Conversation
2759fb8
to
e527a57
Compare
@@ -402,3 +402,38 @@ func getElemOrEmptyMapFromMap(d map[string]interface{}, key string) map[string]i | |||
} | |||
return make(map[string]interface{}) | |||
} | |||
|
|||
func setPolicyLbHTTPHeaderInSchema(d *schema.ResourceData, attrName string, headers []model.LbHttpRequestHeader) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not mind instead creating a generic function that sets an attribute which is a list of key/value pairs. This can be used for tags, headers, and likely more.
I do not have however a strong preference.
"data_length": { | ||
Type: schema.TypeInt, | ||
Optional: true, | ||
Description: "The data size (in byte) of the ICMP healthcheck packet format: int64", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it matter to Terraform users that format is int64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for all in64 parameters from SDK we convert them to Terraform TypeInt
displayName := d.Get("display_name").(string) | ||
description := d.Get("description").(string) | ||
tags := getPolicyTagsFromSchema(d) | ||
dataLength := int64(d.Get("data_length").(int)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why the SDK used int64 for these parameters.... wasted bits imho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems SDK use int64 for all int parameters...
I noticed that in the SDK, the comment next to some parameters says that this parameter is of format int32, however in the SDK code the parameter is still defined as an int64.
For example, Revision
// The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32
Revision *int64
2a59e10
to
b39579e
Compare
b39579e
to
77ef249
Compare
/test-all |
77ef249
to
07da454
Compare
ca48c53
to
a8dcc5f
Compare
/test-all |
bfa65e9
to
56ee5f5
Compare
/test-all |
71fe3d3
to
88103cc
Compare
/test-all |
/test-all |
/test-all |
Implement LB monitor resources using policy API. Types of LB monitors include: - lb_http_monitor - lb_https_monitor - lb_icmp_monitor - lb_passive_monitor - lb_tcp_monitor - lb_udp_monitor Signed-off-by: Shizhao Liu <[email protected]>
eba63ca
to
b11f7a0
Compare
/test-all |
Implement several lb monitor profile resources using policy API including: